﻿using EasyBuyShop.Models;
using EasyBuyShop.Utils;

namespace EasyBuyShop.DAL
{
    public class AddrDal:BaseDal
    {
        public List<Address> GetAddrByUserId(long userId)
        {
            try
            {
                using (var db = this.GetDb(BaseDal.ConnStr))
                {
                    return db.Queryable<Address>().Where(r => r.UserId==userId).ToList();
                }
            }
            catch (Exception ex)
            {
                LogHelper.Fatal(ex.Message);
                return new List<Address>();
            }
        }
    }
}
